version 8.0
log using results.log, replace
#delimit ;

*     ***************************************************************** *;
*     ***************************************************************** *;
*     File-Name:  results.do                                            *;
*     Date:       December 19, 2007                                     *;
*     Author:     SNG                                                   *;
*     Purpose:    find determinants of bargaining delays in govt form.  *;
*                 Final specification, Table 2                          *;
*     Data Used:  delay.dta                                             *;
*     Output File: results.log                                          *;
*     Machine:    laptop (dell)                                         *;
*     ****************************************************************  *;
*     ****************************************************************  *;

set more off;

use "delay.dta";


replace bargainingdays = .01 if bargainingdays==0;

gen post_legislative_parties = postelection * legislative_parties; 
gen post_polariz = postelection * polarization;
gen post_positive = postelection * positive_parl;


stset bargainingdays;


*     ****************************************************************  *;
*                    Model 1: All govts, no interactions                *;
*     ****************************************************************  *;

stcox postelection legislative_parties polarization positive_parl  
continuation singleparty_majority if nonpartisan==0, 
efron nohr robust schoenfeld(sc*) scaledsch(ssc*);

stphtest, detail;
drop sc* ssc*;


*     ****************************************************************  *;
*              Model 2: post-election govts, no interactions            *;
*     ****************************************************************  *;

stcox legislative_parties polarization positive_parl continuation singleparty_majority if nonpartisan==0 & postelection==1, 
efron nohr robust schoenfeld(sc*) scaledsch(ssc*);

stphtest, detail;
drop sc* ssc*;



*     ****************************************************************  *;
*              Model 3: inter-election govts, no interactions           *;
*     ****************************************************************  *;

stcox legislative_parties polarization positive_parl continuation singleparty_majority if nonpartisan==0 & postelection==0, 
efron nohr robust schoenfeld(sc*) scaledsch(ssc*);

stphtest, detail;
drop sc* ssc*;

*     ****************************************************************  *;
*       Since several variables violate the PH assumption, need to      *;
*       interact those variables with the log of time (the bargaining   *;
*       days measure) and re-run the model with the new variable.       *;
*     ****************************************************************  *;

gen ln_time = ln(bargainingdays);

gen time_legislative_parties = ln_time*legislative_parties;

gen time_positive_parl = ln_time*positive_parl;

gen time_continuation = ln_time*continuation;

stcox legislative_parties polarization positive_parl continuation singleparty_majority 
    time_legislative_parties time_positive_parl time_continuation 
    if postelection==0 & nonpartisan==0, efron nohr robust;


*     ****************************************************************  *;
*     Model 4: All govts, complexity vars interacted w/ post-election   *;
*     ****************************************************************  *;

stcox postelection legislative_parties polarization positive_parl   
post_legislative_parties post_polariz post_positive 
continuation singleparty_majority if nonpartisan==0, 
efron nohr robust schoenfeld(sc*) scaledsch(ssc*);

stphtest, detail;
drop sc* ssc*;






log close;
exit;
